import request from '@/utils/request'
// 查询员工列表页面
export const sysUser = (params) => {
  return request({
    url: '/sys/user',
    params
  })
}
// 新增员工
export const sysUserPost = (data) => {
  return request({
    url: '/sys/user',
    method: 'post',
    data
  })
}
// 删除员工
export const sysRoleDelete = (id) => {
  return request({
    url: `/sys/user/${id}`,
    method: 'DELETE'
  })
}
// 批量导入员工
export const sysSserBatch = (data) => {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}
// 获取员工基本信息
export const employeesPersonalInfo = (id) => {
  return request({
    url: `/employees/${id}/personalInfo`
  })
}
// 更新员工个人信息
export const employeesPersonalInfoPut = (data) => {
  return request({
    url: `/employees/${data.userId}/personalInfo`,
    method: 'put',
    data
  })
}
// 获取岗位信息api
export const employeesJobs = (id) => {
  return request({
    url: `/employees/${id}/jobs`
  })
}
// 修改岗位信息api
export const employeesJobsPut = (data) => {
  return request({
    url: `/employees/${data.userId}/jobs`,
    method: 'put',
    data
  })
}
// 给员工分配角色
export const sysUserAssignRolesPut = (data) => {
  return request({
    url: '/sys/user/assignRoles',
    method: 'put',
    data
  })
}
